package com.csaba.swing.action;

import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;

import javax.swing.AbstractAction;
import javax.swing.KeyStroke;

import com.csaba.swing.MainWindow;
import com.csaba.swing.gui.PreferencesDialog;
import com.csaba.swing.gui.util.GUIUtil;

@SuppressWarnings( "serial" )
public class PreferencesAction extends AbstractAction
{
	public PreferencesAction()
	{
		super(MainWindow.getString("PreferencesAction.menuItem")); //$NON-NLS-1$
		setEnabled(true);
		//set icon

		GUIUtil.setMnemonic(this);
		putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F12, 0));
	}

	@Override
	public void actionPerformed( final ActionEvent e )
	{
		final PreferencesDialog dialog = new PreferencesDialog(MainWindow.getFrame());
		dialog.setVisible(true);
	}
}
